package com.ai.entity.made.page;

import com.ai.entity.BasePage;
import com.ai.entity.function.FunctionPO;
import com.ai.entity.made.AlgorithmPackageStatus;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;

/**
 * @Author jiaok
 * @Date 2024-08-12 15:35
 */
@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AlgorithmPackagePage  extends BasePage<AlgorithmPackageStatus> {


    private String functionId;

    @Override
    public QueryWrapper<AlgorithmPackageStatus> getQuery(QueryWrapper<AlgorithmPackageStatus> queryWrapper) {
        return super.getQuery(queryWrapper)
                .eq((StringUtils.isNotBlank(functionId)),"function_id",functionId)
                .ge((!com.alibaba.druid.util.StringUtils.isEmpty(getDatebegin())), "algorithm_package_status.create_time", getDatebegin())
                .lt((!com.alibaba.druid.util.StringUtils.isEmpty(getDateend())), "algorithm_package_status.create_time", getDateend())
                .orderByDesc("algorithm_package_status.create_time");
    }


}
